#include <gtk/gtk.h>
#include <glade/glade.h>
#include <gtktester.h>
GtkWidget *window, *entry, *combo;

void on_apply_clicked (GtkButton *button, gpointer user_data)
{
	gtk_entry_set_text (GTK_ENTRY (entry), gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo)));
	printf("Apply clicked!\n");
}


void on_cancel_clicked (GtkButton *button, gpointer user_data)
{
	printf("Cancel clicked!\n");
}


void on_quit_clicked (GtkButton *button, gpointer user_data)
{
	printf("Quit clicked!\n");
}

int main (int argc, char *argv[])
{
	GladeXML *xml;

	gtktester_init(argc, argv);
	gtk_init (&argc, &argv);

	/* load the interface */
	xml = glade_xml_new("sample.glade", NULL, NULL);
	/* connect the signals in the interface */
	glade_xml_signal_connect(xml, "on_apply_clicked", G_CALLBACK(on_apply_clicked));
	glade_xml_signal_connect(xml, "on_cancel_clicked", G_CALLBACK(on_cancel_clicked));
	glade_xml_signal_connect(xml, "on_quit_clicked", G_CALLBACK(on_quit_clicked));
	/* start the event loop */
	window = glade_xml_get_widget (xml, "window");
	entry = glade_xml_get_widget (xml, "entry");
	combo = glade_xml_get_widget (xml, "combo");
	gtk_widget_show_all (window);
	gtk_main();
	return 0;
}
